<?php

class FoodController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
                $content = new Application_Model_Content_Food();
               $this->view->cont =  $content->getContent();
               $cont = $content->getContent();
               $dir    =    "files/pictures/food";
               $pic = array();
                    if ($handle = opendir($dir)) :
                        while (false !== ($entry = readdir($handle))) :
                            if ($entry != "." && $entry != "..") :
                                if (is_dir($dir."/".$entry) === true):
                                    echo "DIRECTORY: ".$entry."\n";
                                else:
                                //  echo "FILE: ".$entry."\n";
                                                    $pic[] = $entry;
                                endif;
                        endif;
                        endwhile;
                        closedir($handle);
                    endif;
  
        $this->view->dir = $dir;
         $this->view->pic = $pic;
        $this->view->title = $cont[0]['title'];
    }

    public function parseAction()
    {
        $channel = new Zend_Feed_Rss('http://tech.onliner.by/feed');
       $this->view->Title = $channel->title();
       $this->view->link = $channel->link();
       $this->view->channel = $channel;
    }
      public function picturesAction()
    {
    
    }
    


}



